/*
 * @Author: szx
 * @Date: 2022-03-05 13:24:54
 * @LastEditTime: 2022-03-05 13:27:58
 * @Description:
 * @FilePath: \leetcode\1400-1499\1436\1436.js
 */
/**
 * @param {string[][]} paths
 * @return {string}
 */
var destCity = function (paths) {
    const map = new Map();
    for (let p of paths) {
        map.set(p[0], (map.get(p[0]) || 0) + 2);
        map.set(p[1], (map.get(p[1]) || 0) + 1);
    }
    for (let m of map) {
        if (m[1] == 1) return m[0];
    }
};
